<?php
//查询所有的会员
include '../model/db.php';
if(!empty($_GET['type'])&&!empty($_GET['id'])){
    if($_GET['type']=='jy'){
        $stat="2";
    }else if($_GET['type']=='qy'){
        $stat="1";
    }
    $sql="update bl_member set stat =$stat where id='{$_GET['id']}'";
    db_query($sql);
}
$sql="select * from bl_member";
$member=db_sel($sql,2); //得到所有的会员
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>后台 管理中心 - 会员列表 </title>
    <meta name="robots" content="noindex, nofollow">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../public/admin/styles/general.css" rel="stylesheet" type="text/css" />
    <link href="../public/admin/styles/main.css" rel="stylesheet" type="text/css" />
</head>
<body>

<h1>
    <span class="action-span"><a href="./cateadd.php">添加会员</a></span>
    <span class="action-span1"><a href="#">后台 管理中心</a> </span><span id="search_id" class="action-span1"> - 文章会员 </span>
    <div style="clear:both"></div>
</h1>
<form method="post" action="" name="listForm">
    <div class="list-div" id="listDiv">

        <table width="100%" cellspacing="1" cellpadding="2" id="list-table">
            <tr>
                <th>会员id</th>
                <th>会员名称</th>
                <th>注册时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            <?php foreach($member as $v){?>
                <tr>
                    <td><?php echo $v['id']?></td>
                    <td><?php echo $v['user']?></td>
                    <td><?php echo date('Y-m-d',$v['time'])?></td>
                    <td><?php if($v['stat']=='1'){echo '启用';}else{echo '禁用';}?></td>
                    <td>
                        <?php if($v['stat']=='1'){?>
                            <a href="./memberlist.php?type=jy&id=<?php echo $v['id']?>">禁用</a>
                        <?php }else{?>
                            <a href="./memberlist.php?type=qy&id=<?php echo $v['id']?>">启用</a>
                        <?php }?>
                    </td>
                </tr>
            <?php }?>
        </table>
    </div>
</form>

<div id="footer">
    共执行 1 个查询，用时 0.015927 秒，Gzip 已禁用，内存占用 1.999 MB<br />

    版权所有 &copy; 2005-2010 上海商派网络科技有限公司，并保留所有权利
    。</div>

</body>
</html>